import request from '@/utils/request'

const categoryService = {
  // 获取所有分类
  getCategories() {
    return request({
      url: '/api/ProductCategory',
      method: 'get'
    })
  },

  // 创建分类
  createCategory(data) {
    return request({
      url: '/api/ProductCategory',
      method: 'post',
      data
    })
  },

  // 更新分类
  updateCategory(id, data) {
    return request({
      url: `/api/ProductCategory/${id}`,
      method: 'put',
      data
    })
  },

  // 删除分类
  deleteCategory(id) {
    return request({
      url: `/api/ProductCategory/${id}`,
      method: 'delete'
    })
  }
}

export default categoryService